From: Juri Linkov Date: Sun, 30 Aug 2009 23:46:09 +0000 (+0000) Subject: (grep-read-files): Strip trailing from buffer names X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~10756 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=26526ea86a3332e8113d7a028ca099a296ec0566;p=emacs.git (grep-read-files): Strip trailing from buffer names not visiting a file (e.g. cloned buffers). --- diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 5c199016c65..bf626f6e308 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -748,7 +748,8 @@ substitution string. Note dynamic scoping of variables.") (defun grep-read-files (regexp) "Read files arg for interactive grep." - (let* ((bn (or (buffer-file-name) (buffer-name))) + (let* ((bn (or (buffer-file-name) + (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) (fn (and bn (stringp bn) (file-name-nondirectory bn)))